<template>
  <a-tabs type="card" :defaultActiveKey="defaultActiveKey" class="card">
    <a-tab-pane key="1">
      <span slot="tab" class="tab-text">
        <Icon :type="'zk-back-enterprise-imformation'" />企业信息
      </span>
      <div class="tab-content">
        <Info :companyInfo="companyInfo"  @initPage="getCompanyInfo" />
      </div>
    </a-tab-pane>
    <a-tab-pane key="2" v-if="companyInfo.auditState==1">
      <span slot="tab">
        <Icon :type="'zk-back-employees-list'" />员工列表
      </span>
      <div class="tab-content">
        <Staff />
      </div>
    </a-tab-pane>
    <a-tab-pane key="3" v-if="companyInfo.auditState==1&&companyInfo.companyDirection!=1">
      <span slot="tab">
        <Icon :type="'zk-back-client-list'" />客户列表
      </span>
      <div class="tab-content">
        <Client propsPage="client" />
      </div>
    </a-tab-pane>
    <a-tab-pane key="4" v-if="companyInfo.auditState==1&&companyInfo.companyDirection!=2">
      <span slot="tab">
        <Icon :type="'zk-back-supplier-list'" />供应商列表
      </span>
      <div class="tab-content">
        <Client propsPage="provider" />
      </div>
    </a-tab-pane>
    <a-tab-pane key="5" v-if="companyInfo.auditState==1">
      <span slot="tab">
        <Icon :type="'zk-back-hedging-info'" />套保设置
      </span>
      <div class="tab-content">
        <Hedging />
      </div>
    </a-tab-pane>
    <a-tab-pane key="6" v-if="companyInfo.auditState==1">
      <span slot="tab">
        <Icon :type="'zk-back-chapter-info'" />企业章信息
      </span>
      <div class="tab-content">
        <Chapter />
      </div>
    </a-tab-pane>
    <a-tab-pane key="7" v-if="companyInfo.companyDirection!=1&&companyInfo.auditState==1">
      <span slot="tab">
        <Icon :type="'zk-back-enterprise-imformation'" />超量设置
      </span>
      <div class="tab-content">
        <SetExcess :overAmount="companyInfo.overAmount" @initPage="getCompanyInfo" />
      </div>
    </a-tab-pane>
  </a-tabs>
</template>
<script>
import Info from "./Components/Info";
import Staff from "./Components/Staff";
import Client from "./Components/Client";
import Hedging from "./Components/Hedging";
import Chapter from "./Components/sealInfo";
import SetExcess from "./Components/SetExcess";
import { getCompanyPreauthById } from "@/api/company/companys";
export default {
  components: {
    Info,
    Staff,
    Client,
    Hedging,
    Chapter,
    SetExcess
  },
  data() {
    return {
      defaultActiveKey: "1",
      companyInfo: {}
    };
  },
  created() {
    this.getCompanyInfo();
    if (this.$route.query.page == "chapter") {
      this.defaultActiveKey = "6";
    }
  },
  methods: {
    //获取企业信息
    getCompanyInfo() {
      getCompanyPreauthById({
        companyPreauthId: this.$route.query.id
      })
      .then(res => {
        this.companyInfo = res.data;
      })
      .catch(() => {});
    }
  }
};
</script>
<style lang='less' scoped>
.card {
  padding: 20px;
}
.tab-content {
  margin: 5px;
}
::v-deep .ant-tabs-nav .ant-tabs-tab .anticon,
.tab-content {
  margin: 0;
}
::v-deep .ant-card-body {
  padding: 20px;
}
::v-deep .ant-card,::v-deep .ant-tabs {
  color: #303133;
}
</style>


      